//
//  LBXWaldenFilter.mm
//  OpenGLGame
//
//  Created by Nguyen Cong Huy on 4/5/13.
//  Copyright (c) 2013 UIT. All rights reserved.
//

#include "LBXWaldenFilter.h"
#include "LBToneMapFilter.h"
#include "LBSharpenFilter.h"
#include "LBVignetteFilter.h"
#include "LBUtils.h"

LBXWaldenFilter::LBXWaldenFilter(){
    toneMap = new LBToneMapFilter();
    
    vignette = new LBVignetteFilter();
    vignette->setStart(0.5);
    vignette->setEnd(0.9);
    
    sharpen = new LBSharpenFilter();
    sharpen->setSharpness(0.2);
    
    toneMap->addTarget(vignette)->addTarget(sharpen);
    firstFilter = toneMap;
}

LBXWaldenFilter::~LBXWaldenFilter(){
    outputTexture = 0;
    DELETE_SAFELY(toneMap);
    DELETE_SAFELY(vignette);
    DELETE_SAFELY(sharpen);
}

void LBXWaldenFilter::setToneData(unsigned char* toneData){
    toneMap->setToneData(toneData);
}